package rmhc.api.vk
{
	import rmhc.api.dataflow.WallPostInfo;
	import rmhc.api.tasks.IWallPost;
	import rmhc.gui.customTrace;
	import rmhc.gui.SupplyFunctions;
	import rmhc.RMHCApp;
	
	public class WallPost extends VkApiTask implements IWallPost
	{
		private var postId:String;
		public function WallPost(wrapper:VkApi,post:WallPostInfo)
		{
			var owner_id:String = post.wallId;
			/*if(post.wallId){
				owner_id = post.wallId;
			}else {
				owner_id = wrapper.getUID();
			}*/
			var message:String = post.descr;
			super(wrapper, "wall.post" , { "owner_id" : owner_id, "message" : message, "attachments": post.mediaId+","+post.link});
		}
		public function getPostId():String {
			return postId;
		}

		override public function parseData(result:Object):void
		{
			customTrace("UploadProfilePhoto:parseData:" + SupplyFunctions.objectToString(result));
			postId = result.post_id;
			onComplete();
		}
		
	}
}